const { Schema, model } = require('mongoose');

//设置数据集合
const insuranceTypeSchema = new Schema({
    name: String,
    //保险险种关联保险产品，数组形式
    insurancesId: [{
        type: Schema.Types.ObjectId,
        ref: 'Insurances'
    }],
}, { versionKey: false });

//设置数据集合的模型
const InsuranceType = model('InsuranceType', insuranceTypeSchema, 'insuranceType');

//暴露
module.exports.InsuranceType = InsuranceType;